Add list deconstruction similar to Lisp for function arguments.#148
Add list deconstruction similar to Lisp for function arguments.#148Habush wants to merge 4 commits into
Conversation
patham9
left a comment
There was a problem hiding this comment.
Hm, sure it should be infix?
In what way is it better than the already supported (cons $head $tail) pattern?
A testcase would be needed to see I guess.
|
The |
|
Thank you though! Can we have is-ground by itself for now in this PR @Habush ? Then I am happy to merge it |
It was a style choice as it is common list deconstruction pattern in Lisp-like languages. But I understand if infix operators don't match PeTTa's style. I have removed the operator and the PR now contains only |
patham9
left a comment
There was a problem hiding this comment.
Hm is-ground also needs to be registered I suppose? Do you have a testcase for it?
|
@Habush if you register the function we can merge the PR |
Signed-off-by: Abdulrahman S. Omar <hsamireh@gmail.com>
|
Registered the function. Please check |
|
It also removes is-alpha-member, why? |
|
Oops, that was by mistake. I'll close this PR and create a now for a cleaner commit history |
|
Closed in favor #172 |
.operator. This will provide a syntactic sugar of the form(= (sum ($head . $rest) )...))is-ground/1predicate for checking if an expression is a ground expression. A complement to the already existingis-var/1predicate.